
public class Test {
    /**
     * 二叉树的创建 + 二叉树的遍历
     */
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode ret = binaryTree.createBinaryTree();
        System.out.println(ret.val);

        binaryTree.preOrder(ret);
        System.out.println();
        binaryTree.inOrder(ret);
        System.out.println();
        binaryTree.postOrder(ret);
        System.out.println();
    }
    /**
     * 栈实现队列
     * @param args
     */
    public static void main1(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.push(1);
        myQueue.push(2);
        System.out.println(myQueue.peek()); // return 1
        System.out.println(myQueue.pop());// return 1, queue is [2]
        System.out.println(myQueue.empty()); // return false
    }
}
